In [1]:
import pandas as pd

Below is the data as of the latest F2S Census (6/27/16)

Original data can be found at https://farmtoschoolcensus.fns.usda.gov

I filtered the data below for schools in CA, in San Diego County, and that have either already been participating in F2S in some capacity or have just started in the 2014-2015 school year.


In [3]:
# Read in the excel file and display
census_df = pd.read_excel('2015 F2S Census SFA Data_6.27.16_web.xlsx', sheetname='2015 F2S Census + CCD')
census_df.head()


Out[3]:
SFAname state husscawardwinner oneinamelonwinner oneinamelonstory USDAF2SGrantee topdistricts newzipc sfaid Year ... HPALM HPALF TR TRALM TRALF TOTETH CHRTLEASTAT MZIP ccdnum farmrate
0 Alaska Gateway School District AK NaN 1.0 Alaska Gateway has a great greenhouse program! 1.0 1.0 99780 00301 2015.0 ... 0 0 9 4 5 404 NOTCHR NaN 200050.0 0.693069
1 Aleutians East Borough School District AK NaN NaN NaN NaN NaN 99661 05601 2015.0 ... 4 4 9 6 3 249 NOTCHR NaN 200007.0 0.510040
2 Annette Island School District AK NaN NaN NaN NaN NaN 99926 00601 2015.0 ... 0 2 0 0 0 292 NOTCHR NaN 200525.0 0.625571
3 Bering Strait School District AK NaN NaN NaN NaN NaN 99684 00701 2015.0 ... 0 0 1 0 1 1904 NOTCHR NaN 200020.0 0.814601
4 Bristol Bay Borough School District AK NaN NaN NaN NaN NaN 99633 00801 2015.0 ... 2 1 0 0 0 151 NOTCHR NaN 200030.0 0.430464

5 rows × 563 columns


In [8]:
# Filter the dataframe, fill na values, and display
census_df_CA = census_df[census_df['state'] == 'CA']
census_df_SD = census_df_CA[census_df_CA['CONAME'] == 'SAN DIEGO COUNTY']
census_df_SD = census_df_SD[census_df_SD['F2S'] <= 2]
census_df_SD.fillna(0, inplace=True)
census_df_SD.head()


Out[8]:
SFAname state husscawardwinner oneinamelonwinner oneinamelonstory USDAF2SGrantee topdistricts newzipc sfaid Year ... HPALM HPALF TR TRALM TRALF TOTETH CHRTLEASTAT MZIP ccdnum farmrate
706 Bonsall Union Elementary School District CA 0.0 0.0 0 0.0 0.0 92003 02420 2015.0 ... 7 7 129 73 56 2260 NOTCHR 92003.0 605670.0 0.354139
707 Borrego Springs Unified School District CA 0.0 0.0 0 0.0 0.0 92004 02421 2015.0 ... 0 0 16 9 7 521 NOTCHR 92004.0 605700.0 0.846449
722 Cajon Valley Union School District CA 0.0 0.0 0 0.0 0.0 92022 02423 2015.0 ... 37 49 1011 509 502 16420 NOTCHR 92022.0 606810.0 0.641973
756 Chula Vista Elementary School District CA 0.0 0.0 0 0.0 0.0 91910 02427 2015.0 ... 73 87 879 441 438 29472 NOTCHR 0.0 608610.0 0.493282
788 Del Mar Union Elementary School District CA 0.0 0.0 0 0.0 0.0 92009 02433 2015.0 ... 6 4 236 112 124 4376 NOTCHR 92130.0 610740.0 0.043717

5 rows × 563 columns


In [10]:
# Perform calculations and display
print('Number of school districts currently participating in F2S or started in 2014-2015 school year:', 
     len(list(census_df_SD['SFAname'].unique())))
print('Number of schools in those school districts:', 
     census_df_SD['schoolnum'].astype(int).sum())
print('Number of school gardens in those schools/districts:', 
     census_df_SD['gardennum'].astype(int).sum())


Number of school districts currently participating in F2S or started in 2014-2015 school year: 27
Number of schools in those school districts: 538
Number of school gardens in those schools/districts: 191

In [ ]: